package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NursingPlanMapper {
    /**
     * 新增护理计划
     * 必须完成主键Id的自增并完成数据的封装返回给nursingPlan对象
     * @param nursingPlan
     */
    void insert(NursingPlan nursingPlan);

    /**
     * 根据Id查询护理计划
     * @param id
     * @return
     */
    @Select("select * from nursing_plan where id = #{id}")
    NursingPlan getById(@Param("id") Integer id);

    /**
     * 分页查询护理计划
     * @param name
     * @param status
     * @return
     */
    Page<NursingPlanVo> selectPage(String name, Integer status);

    /**
     * 动态更新护理计划
     * @param nursingPlan
     */
    void update(NursingPlan nursingPlan);

    /**
     * 根据Id删除护理计划
     * @param id
     */
    @Delete("delete from nursing_plan where id = #{id}")
    void delById(Integer id);

    /**
     * 查询所有护理计划
     * @return
     */
    @Select("select * from nursing_plan")
    List<NursingPlanVo> getAllPlan();
}
